.class public Lcom/netease/newsreader/adapter/CommentAdapter;
.super Landroid/widget/ArrayAdapter;
.source "CommentAdapter.java"

# interfaces
.implements Lcom/netease/newsreader/view/FloorsView$FloorBinder;
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/widget/ArrayAdapter",
        "<",
        "Ljava/util/Map",
        "<",
        "Ljava/lang/String;",
        "Ljava/lang/Object;",
        ">;>;",
        "Lcom/netease/newsreader/view/FloorsView$FloorBinder;",
        "Landroid/view/View$OnClickListener;"
    }
.end annotation


# instance fields
.field private mLayoutInflater:Landroid/view/LayoutInflater;

.field private mTextSize:F

.field private mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/util/List;)V
    .locals 1
    .parameter "context"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/List",
            "<",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;)V"
        }
    .end annotation

    .prologue
    .line 38
    .local p2, objects:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    const/4 v0, 0x0

    invoke-direct {p0, p1, v0, p2}, Landroid/widget/ArrayAdapter;-><init>(Landroid/content/Context;ILjava/util/List;)V

    .line 39
    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/adapter/CommentAdapter;->mLayoutInflater:Landroid/view/LayoutInflater;

    .line 40
    invoke-static {p1}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->getThemeSettingsHelper(Landroid/content/Context;)Lcom/netease/newsreader/util/ThemeSettingsHelper;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/adapter/CommentAdapter;->mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    .line 41
    return-void
.end method


# virtual methods
.method public bindFloor(Landroid/view/ViewGroup;ILjava/lang/Object;I)V
    .locals 9
    .parameter "floor"
    .parameter "position"
    .parameter "data"
    .parameter "floorCount"

    .prologue
    .line 86
    iget-object v6, p0, Lcom/netease/newsreader/adapter/CommentAdapter;->mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    invoke-virtual {p0}, Lcom/netease/newsreader/adapter/CommentAdapter;->getContext()Landroid/content/Context;

    move-result-object v7

    const v8, 0x7f02001a

    invoke-virtual {v6, v7, p1, v8}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setViewBackgroud(Landroid/content/Context;Landroid/view/View;I)V

    move-object v6, p3

    .line 89
    check-cast v6, Ljava/util/Map;

    const-string v7, "bd"

    .line 88
    invoke-static {v6, v7}, Lcom/netease/newsreader/util/ModelUtils;->getValue(Ljava/util/Map;Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/util/Map;

    .line 91
    .local v3, map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    if-eqz v3, :cond_0

    invoke-interface {v3}, Ljava/util/Map;->size()I

    move-result v6

    const/4 v7, 0x1

    if-gt v6, v7, :cond_1

    :cond_0
    const/4 v1, 0x0

    .line 93
    .local v1, count:I
    :goto_0
    const v6, 0x7f0c00fb

    invoke-virtual {p1, v6}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    .line 96
    .local v2, hideView:Landroid/widget/TextView;
    const/4 v6, 0x4

    if-le v1, v6, :cond_3

    .line 97
    const/4 v6, 0x2

    if-ne p2, v6, :cond_2

    .line 98
    const v6, 0x7f0c00fa

    invoke-virtual {p1, v6}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v6

    const/16 v7, 0x8

    invoke-virtual {v6, v7}, Landroid/view/View;->setVisibility(I)V

    .line 99
    const/4 v6, 0x0

    invoke-virtual {v2, v6}, Landroid/widget/TextView;->setVisibility(I)V

    .line 100
    invoke-virtual {v2, p3}, Landroid/widget/TextView;->setTag(Ljava/lang/Object;)V

    .line 101
    iget v6, p0, Lcom/netease/newsreader/adapter/CommentAdapter;->mTextSize:F

    invoke-virtual {v2, v6}, Landroid/widget/TextView;->setTextSize(F)V

    .line 118
    :goto_1
    return-void

    .line 91
    .end local v1           #count:I
    .end local v2           #hideView:Landroid/widget/TextView;
    :cond_1
    invoke-interface {v3}, Ljava/util/Map;->size()I

    move-result v6

    add-int/lit8 v1, v6, -0x1

    goto :goto_0

    .line 103
    .restart local v1       #count:I
    .restart local v2       #hideView:Landroid/widget/TextView;
    :cond_2
    const/4 v6, 0x2

    if-le p2, v6, :cond_3

    .line 104
    add-int/lit8 v6, v1, -0x5

    add-int/2addr p2, v6

    .line 107
    :cond_3
    const v6, 0x7f0c00fa

    invoke-virtual {p1, v6}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v6

    const/4 v7, 0x0

    invoke-virtual {v6, v7}, Landroid/view/View;->setVisibility(I)V

    .line 108
    const/16 v6, 0x8

    invoke-virtual {v2, v6}, Landroid/widget/TextView;->setVisibility(I)V

    .line 109
    const v6, 0x7f0c0056

    invoke-virtual {p1, v6}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v5

    check-cast v5, Landroid/widget/TextView;

    .line 110
    .local v5, username:Landroid/widget/TextView;
    const v6, 0x7f0c0057

    invoke-virtual {p1, v6}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/TextView;

    .line 111
    .local v4, num:Landroid/widget/TextView;
    const v6, 0x7f0c0058

    invoke-virtual {p1, v6}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    .line 112
    .local v0, content:Landroid/widget/TextView;
    add-int/lit8 v6, p2, 0x1

    invoke-static {v6}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v6

    invoke-static {v3, v6}, Lcom/netease/newsreader/util/ModelUtils;->getValue(Ljava/util/Map;Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v3

    .end local v3           #map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    check-cast v3, Ljava/util/Map;

    .line 113
    .restart local v3       #map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    const-string v6, "f"

    invoke-static {v3, v6}, Lcom/netease/newsreader/util/ModelUtils;->getValue(Ljava/util/Map;Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/lang/String;

    invoke-virtual {v5, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 115
    add-int/lit8 v6, p2, 0x1

    invoke-static {v6}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v4, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 116
    const-string v6, "b"

    invoke-static {v3, v6}, Lcom/netease/newsreader/util/ModelUtils;->getValue(Ljava/util/Map;Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/lang/String;

    invoke-virtual {v0, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 117
    iget v6, p0, Lcom/netease/newsreader/adapter/CommentAdapter;->mTextSize:F

    invoke-virtual {v0, v6}, Landroid/widget/TextView;->setTextSize(F)V

    goto :goto_1
.end method

.method public createFloorContentView(Ljava/lang/Object;)Landroid/view/View;
    .locals 5
    .parameter "datas"

    .prologue
    .line 122
    iget-object v2, p0, Lcom/netease/newsreader/adapter/CommentAdapter;->mLayoutInflater:Landroid/view/LayoutInflater;

    const v3, 0x7f03003f

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    .line 123
    .local v0, floor:Landroid/view/View;
    const v2, 0x7f0c00fb

    invoke-virtual {v0, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    .line 124
    .local v1, hideView:Landroid/view/View;
    invoke-virtual {v1, p0}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 125
    return-object v0
.end method

.method public getFloorCount(Ljava/lang/Object;)I
    .locals 4
    .parameter "data"

    .prologue
    .line 131
    check-cast p1, Ljava/util/Map;

    .end local p1
    const-string v2, "bd"

    .line 130
    invoke-static {p1, v2}, Lcom/netease/newsreader/util/ModelUtils;->getValue(Ljava/util/Map;Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map;

    .line 133
    .local v0, map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    if-eqz v0, :cond_0

    invoke-interface {v0}, Ljava/util/Map;->size()I

    move-result v2

    const/4 v3, 0x1

    if-gt v2, v3, :cond_2

    :cond_0
    const/4 v1, 0x0

    .line 135
    .local v1, size:I
    :goto_0
    const/4 v2, 0x4

    if-le v1, v2, :cond_1

    .line 136
    const/4 v1, 0x5

    .line 138
    .end local v1           #size:I
    :cond_1
    return v1

    .line 133
    :cond_2
    invoke-interface {v0}, Ljava/util/Map;->size()I

    move-result v2

    add-int/lit8 v1, v2, -0x1

    goto :goto_0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 11
    .parameter "position"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    const v10, 0x7f0c00fe

    .line 52
    if-nez p2, :cond_0

    .line 53
    iget-object v7, p0, Lcom/netease/newsreader/adapter/CommentAdapter;->mLayoutInflater:Landroid/view/LayoutInflater;

    const v8, 0x7f030040

    const/4 v9, 0x0

    invoke-virtual {v7, v8, v9}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    .line 54
    invoke-virtual {p2, v10}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v3

    check-cast v3, Lcom/netease/newsreader/view/FloorsView;

    .line 55
    .local v3, floors:Lcom/netease/newsreader/view/FloorsView;
    invoke-virtual {v3, p0}, Lcom/netease/newsreader/view/FloorsView;->setFloorBinder(Lcom/netease/newsreader/view/FloorsView$FloorBinder;)V

    .line 59
    .end local v3           #floors:Lcom/netease/newsreader/view/FloorsView;
    :cond_0
    const v7, 0x7f0c00fc

    invoke-virtual {p2, v7}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v6

    check-cast v6, Landroid/widget/TextView;

    .line 60
    .local v6, username:Landroid/widget/TextView;
    const v7, 0x7f0c00fd

    invoke-virtual {p2, v7}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    .line 61
    .local v2, date:Landroid/widget/TextView;
    const v7, 0x7f0c00ff

    invoke-virtual {p2, v7}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    .line 62
    .local v0, content:Landroid/widget/TextView;
    const v7, 0x7f0c0100

    invoke-virtual {p2, v7}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v5

    check-cast v5, Landroid/widget/TextView;

    .line 63
    .local v5, orig:Landroid/widget/TextView;
    invoke-virtual {p2, v10}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v3

    check-cast v3, Lcom/netease/newsreader/view/FloorsView;

    .line 65
    .restart local v3       #floors:Lcom/netease/newsreader/view/FloorsView;
    invoke-virtual {p0, p1}, Lcom/netease/newsreader/adapter/CommentAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/Map;

    .line 66
    .local v1, data:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    if-eqz v1, :cond_1

    invoke-interface {v1}, Ljava/util/Map;->size()I

    move-result v7

    if-nez v7, :cond_2

    .line 67
    :cond_1
    new-instance v1, Ljava/util/HashMap;

    .end local v1           #data:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    invoke-direct {v1}, Ljava/util/HashMap;-><init>()V

    .line 70
    .restart local v1       #data:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    :cond_2
    const-string v7, "fn"

    invoke-static {v1, v7}, Lcom/netease/newsreader/util/ModelUtils;->getValue(Ljava/util/Map;Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Ljava/lang/String;

    invoke-virtual {v6, v7}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 72
    const-string v7, "bd"

    .line 71
    invoke-static {v1, v7}, Lcom/netease/newsreader/util/ModelUtils;->getValue(Ljava/util/Map;Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/util/Map;

    .line 73
    .local v4, map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    invoke-interface {v4}, Ljava/util/Map;->size()I

    move-result v7

    invoke-static {v7}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v7

    invoke-static {v4, v7}, Lcom/netease/newsreader/util/ModelUtils;->getValue(Ljava/util/Map;Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v4

    .end local v4           #map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    check-cast v4, Ljava/util/Map;

    .line 75
    .restart local v4       #map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    const-string v7, "t"

    invoke-static {v4, v7}, Lcom/netease/newsreader/util/ModelUtils;->getValue(Ljava/util/Map;Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Ljava/lang/String;

    invoke-static {v7}, Lcom/netease/newsreader/util/StringUtil;->getDate(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v2, v7}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 76
    new-instance v7, Ljava/lang/StringBuilder;

    invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p0}, Lcom/netease/newsreader/adapter/CommentAdapter;->getContext()Landroid/content/Context;

    move-result-object v8

    const v9, 0x7f0b00ad

    invoke-virtual {v8, v9}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;

    move-result-object v8

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v8

    .line 77
    const-string v7, "s"

    invoke-static {v4, v7}, Lcom/netease/newsreader/util/ModelUtils;->getValue(Ljava/util/Map;Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Ljava/lang/String;

    invoke-virtual {v8, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    .line 76
    invoke-virtual {v5, v7}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 78
    const-string v7, "b"

    invoke-static {v4, v7}, Lcom/netease/newsreader/util/ModelUtils;->getValue(Ljava/util/Map;Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Ljava/lang/String;

    invoke-virtual {v0, v7}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 79
    iget v7, p0, Lcom/netease/newsreader/adapter/CommentAdapter;->mTextSize:F

    invoke-virtual {v0, v7}, Landroid/widget/TextView;->setTextSize(F)V

    .line 80
    invoke-virtual {v3, v1}, Lcom/netease/newsreader/view/FloorsView;->setFloorsValue(Ljava/util/Map;)V

    .line 81
    return-object p2
.end method

.method public onClick(Landroid/view/View;)V
    .locals 5
    .parameter "v"

    .prologue
    .line 143
    invoke-virtual {p1}, Landroid/view/View;->getId()I

    move-result v3

    packed-switch v3, :pswitch_data_0

    .line 162
    :cond_0
    :goto_0
    return-void

    .line 145
    :pswitch_0
    invoke-virtual {p1}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map;

    .line 146
    .local v0, data:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    if-eqz v0, :cond_0

    .line 150
    invoke-static {v0}, Lcom/netease/newsreader/util/ModelUtils;->map2Json(Ljava/util/Map;)Lorg/json/JSONObject;

    move-result-object v2

    .line 151
    .local v2, json:Lorg/json/JSONObject;
    if-eqz v2, :cond_0

    .line 152
    new-instance v1, Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/netease/newsreader/adapter/CommentAdapter;->getContext()Landroid/content/Context;

    move-result-object v3

    const-class v4, Lcom/netease/newsreader/activity/CommentWholeFloorActivity;

    invoke-direct {v1, v3, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 153
    .local v1, intent:Landroid/content/Intent;
    const-string v3, "floorData"

    invoke-virtual {v2}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v3, v4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 154
    invoke-virtual {p0}, Lcom/netease/newsreader/adapter/CommentAdapter;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-virtual {v3, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    goto :goto_0

    .line 143
    :pswitch_data_0
    .packed-switch 0x7f0c00fb
        :pswitch_0
    .end packed-switch
.end method

.method public setTextSize(F)V
    .locals 1
    .parameter "size"

    .prologue
    .line 44
    iget v0, p0, Lcom/netease/newsreader/adapter/CommentAdapter;->mTextSize:F

    cmpl-float v0, v0, p1

    if-eqz v0, :cond_0

    .line 45
    iput p1, p0, Lcom/netease/newsreader/adapter/CommentAdapter;->mTextSize:F

    .line 46
    invoke-virtual {p0}, Lcom/netease/newsreader/adapter/CommentAdapter;->notifyDataSetChanged()V

    .line 48
    :cond_0
    return-void
.end method
